package ch7Array;

import java.util.Scanner;

public class Test10 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("输入数组arr9的长度：");
        boolean isSame = true;
        int length9 = scan.nextInt();
        System.out.println("输入数组arr10的长度：");
        int length10 = scan.nextInt();
        int[] arr9 = new int[length9];
        int[] arr10 = new int[length10];
        System.out.println("请输入数组arr9中的"+length9+"个元素：");
        for(int i= 0;i<arr9.length;i++){
            arr9[i]=scan.nextInt();
        }
        System.out.println("请输入数组arr10中的"+length10+"个元素");
        for(int j= 0;j<arr10.length;j++){
            arr10[j]=scan.nextInt();
        }
        if(arr9.length==arr10.length){
            for(int k =0;k<arr9.length;k++){
                if(arr9[k]==arr10[k]){
                    isSame = false;
                    continue;
                }else{
                    isSame = true;
                    break;
                }
            }
            if(isSame ==false){
                System.out.println("两个数组相同！");
            } else {
                System.out.println("数组arr9与数组arr10不一样！");
            }
        }else{
            System.out.println("两个数组不同！");
        }
    }

}
